/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

$(document).ready(function(){
    $('#retroMg').blur(function(){
        $.post(
            '/z.palza/cake/retrospectives/validate_form',
            {field: $('#retroMg').attr('id'), value: $('#retroMg').val()},
            handleNameValidation
        )
    })
    function handleNameValidation(error){
        if(error.length>0){
            if($('#retroMg-notEmpty').length==0){
                $('#retroMg').after('<div id="retroMg-notEmpty" class="error-message">'+error+'</div>');
            }
            else{
                $('#retroMg-notEmpty').remove();
            }
        }
    }
});
